package com.itheima.pattern.interpreter;


//变量类
public class Variable extends AbstractExpression{
    private String name;
    public Variable(String name){
        this.name=name;
    }



    @Override
    public String toString() {
        return name;
    }


    @Override
    public int interpret(Context context) {
        return context.getValue(this);
    }
}
